package prv.pursuivant.core.impl;

import java.util.Date;

import prv.pursuivant.core.AchievementStatus;

public class AchievementStatusImpl implements AchievementStatus {

	private final Date date;
	private final Integer done;
	private final Integer all;
	private final Date lastDate;

	public AchievementStatusImpl(Date date, Date lastDate, Integer done,
			Integer all) {
		this.date = date;
		this.lastDate = lastDate;
		this.done = done;
		this.all = all;
	}

	@Override
	public Integer getAllCriteriaCount() {
		return all;
	}

	@Override
	public Integer getDoneCriteriaCount() {
		return done;
	}

	@Override
	public boolean isDone() {
		return date != null;
	}

	@Override
	public Date getDate() {
		return date;
	}

	@Override
	public boolean isDoneImplicit() {
		return isDone() || (done > 0 && done.equals(all));
	}

	@Override
	public Date getLastDate() {
		return lastDate;
	}

}
